package com.ruoyi.fjtseac.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.xss.Xss;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author jxl
 * @since 2022-07-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Essay对象", description="")
public class  Essay implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "文章id")
    @TableId(value = "essay_id", type = IdType.AUTO)
    private Integer essayId;

    @Xss(message = "文章标题不能为脚本语言")
    @ApiModelProperty(value = "文章标题")
    @NotNull(message = "文章标题不能为空")
    private String title;

    @ApiModelProperty(value = "文章发表时间")
    @NotNull(message = "文章发表时间不能为空")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "内容")
    @NotNull(message = "文章内容不能为空")
    private String content;

    @ApiModelProperty(value = "文章封面图url")
    @NotNull(message = "文章封面不能为空")
    private String coverUrl;

    @ApiModelProperty(value = "文章类别id")
    @NotNull(message = "文章类别不能为空")
    private Integer typeId;

    @ApiModelProperty(value = "是否为轮播文章")
    @Min(message = "不可小于0", value = 0L)
    @Max(message = "不可大于1", value = 1L)
    private Integer isCarousel;

    @ApiModelProperty(value = "浏览量")
    private Integer pv;
}
